﻿<Window x:Class="PatientDiagnosisWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:my1="clr-namespace:WpfCheckListBox;assembly=WpfCheckListBox"
        xmlns:dw="clr-namespace:HMSLibrary;assembly=HMSLibrary"
    SizeToContent="WidthAndHeight" WindowStyle="None" AllowsTransparency="True" Icon="/Horizon.HMS;component/Images/POSIcon.ico"
    xmlns:local="clr-namespace:Horizon.HMS" WindowStartupLocation="CenterScreen" Background="Transparent" >
    <Window.Resources>
        <HierarchicalDataTemplate x:Key="CheckBoxItemTemplate" ItemsSource="{Binding subItems}">
            <StackPanel Orientation="Horizontal">
                <CheckBox Focusable="False" IsChecked="{Binding Checked}" VerticalAlignment="Center"/>
                <ContentPresenter Content="{Binding Name}" Margin="2,0"/>
            </StackPanel>
        </HierarchicalDataTemplate>

        <Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
            <Setter Property="IsExpanded" Value="True" />
            <Setter Property="IsSelected" Value="{Binding IsInitiallySelected, Mode=OneTime}" />
            <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
            <Setter Property="dw:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
            <Setter Property="dw:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
        </Style>
    </Window.Resources>
    <Border Background="White" BorderBrush="Navy" BorderThickness="2" CornerRadius="10" Width="520">
        <Grid Margin="10" Background="{StaticResource WindowBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
            <TextBlock Margin="20,2" FontSize="16" FontWeight="SemiBold" Foreground="{StaticResource TextLabelColor}">
            <Run Text="HMS (" />
            <Run Text="Your management partner..." FontSize="10" FontStyle="Italic"/>
            <Run Text=")" />
            <Run Text=" :: Diagnosis"/>
        </TextBlock>
        <Button Grid.Column="2" Style="{DynamicResource CloseButtonStyle}" Width="11.195" Content="Button" x:Name="CloseButton" Cursor="Hand" HorizontalAlignment="Right" Margin="0,5.583,7.468,0" VerticalAlignment="Top" Height="12.77"/>
        <Button Grid.Column="2" Style="{DynamicResource MinimizeButtonStyle}" Width="12.402" Content="Button" x:Name="MinimizeButton" Cursor="Hand" HorizontalAlignment="Right" Margin="0,4.733,24.606,0" VerticalAlignment="Top" Height="13.537"/>
            <Path Data="M18,115 L616,115" Fill="#FFF4F4F5" Height="1" Margin="5" Width="520" Stretch="Fill" Stroke="White" Grid.Row="1" Grid.ColumnSpan="2"/>
            <Grid Grid.Row="2" Name="MainStack" Margin="5" HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal">
                    <RadioButton Content="Diagnosis Tree" Name="DiagnosisTreeRadioButton" Margin="5" GroupName="d" IsChecked="True"/>
                    <RadioButton Content="Diagnosis List" Name="DiagnosisListRadioButton" Margin="5" GroupName="d"/>
                </StackPanel>
                <my:DataGrid AutoGenerateColumns="False" Margin="5" Visibility="Collapsed" Height="200" VerticalAlignment="Top" IsReadOnly="True" Grid.Row="1" Name="DiagnosisDataGrid" >
                    <my:DataGrid.Columns>
                        <my:DataGridTemplateColumn Header="Diagnosis"  Width="150">
                            <my:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <CheckBox/>
                                        <TextBlock Text="{Binding Name}" />
                                    </StackPanel>
                                </DataTemplate>
                            </my:DataGridTemplateColumn.CellTemplate>
                        </my:DataGridTemplateColumn>
                        <my:DataGridTextColumn Header="Section" Binding="{Binding ParentName}" Width="150"/>
                        <my:DataGridTextColumn Header="Remarks" Binding="{Binding Description}" />
                    </my:DataGrid.Columns>
                </my:DataGrid>
                <TreeView Name="DiagnosisTreeView" Grid.Row="1" Margin="5" Height="200" ItemContainerStyle="{StaticResource TreeViewItemStyle}"  ItemTemplate="{StaticResource CheckBoxItemTemplate}">
                  
                </TreeView>
            </Grid>
            <StackPanel Grid.Row="2" Grid.Column="1" Margin="3,100">
                <Button Content="Add Diagnosis" Name="AddDiagnosisButton" Height="30" Width="80" Margin="3"/>
                <Button Content="Add New Diagnosis" Name="AddNewDiagnosisButton" Height="30" Width="110" Margin="3"/>
            </StackPanel>
        </Grid>
    </Border>
</Window>
